{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>分润列表</h5>
        </div>
        <div class="ibox-content" id="branch">
            <!--搜索框开始-->
            <div class="layui-col-xs12 action">
                <a href="{:url('import')}" class="layui-btn layui-btn-small">导入</a>
            </div>
            <!--搜索框结束-->
            <div class="example-wrap">
                <div class="example">
                    <table class="layui-table"
                           lay-data="{height:'full-210',url:'index',method:'post',page:true,id:'member',limit:20}"
                           lay-filter="member">
                        <thead>
                        <tr>
                            <th lay-data="{field:'id',fixed:true,title:'ID',align:'center',sort:true,width:60}"></th>

                            <th lay-data="{toolbar:'#toolbar',title:'操作',align:'center',width:120,fixed:'right'}"></th>
                        </tr>
                        </thead>
                    </table>

                    <script type="text/html" id="toolbar">
                        <div class="layui-btn-group">
                            <button class="layui-btn layui-btn-xs" style="margin: 0;" lay-event="inc">加余额</button>
                            <button class="layui-btn layui-btn-xs layui-btn-danger" style="margin: 0;" lay-event="dec">
                                减余额
                            </button>
                        </div>
                    </script>

                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->

<!-- 加载动画 -->
<div class="spiner-example">
    <div class="sk-spinner sk-spinner-three-bounce">
        <div class="sk-bounce1"></div>
        <div class="sk-bounce2"></div>
        <div class="sk-bounce3"></div>
    </div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
    var table = layui.table, form = layui.form;
    $(".spiner-example").css('display', 'none'); //数据加载完关闭动画

    /**
     * 监听工具条
     */
    table.on('tool(member)', function (obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
        var data = obj.data; //获得当前行数据
        var layEvent = obj.event; //获得 lay-event 对应的值（也可以是表头的 event 参数对应的值）

        if (layEvent === 'inc') { // 加积分

        }
    });

</script>
</body>
</html>